import { RequestConfig } from 'umi';

export const request: RequestConfig = {
//   timeout: 1000,
  errorConfig: {},
  middlewares: [],
  requestInterceptors: [(url, options) => {
    let token = localStorage.getItem('token')

    
    if(token){
      return {
        url: `${url}&interceptors=yes`,
        options: { ...options, interceptors: true , headers:{'Authorization':token} },
      };

    }else{
      return {
        url: `${url}&interceptors=yes`,
        options: { ...options, interceptors: true ,  },
      };
    }
  }],
  responseInterceptors: [],
};